cd "E:\Stata Output"
use "D:\Dropbox\InformedVoting\informed_fund_level.dta", clear
egen style=group(crsp_obj_cd2)
egen style_year=group(crsp_obj_cd_year)
egen mgmt_co=group(mgmt_no2)

* Table 3
reghdfe vote_alpha vote_alpha_lag, cluster(mgmt_co) absorb(style year)
outreg using informed_t3.doc, bdec(3) starlevels(10 5 1) tdec(2) summstat(N\r2_a) nodisplay replace
reghdfe vote_alpha vote_alpha_lag size fsize log_fund_age index_fund2 mret_style_adj_pr12 mret_style_adj_std flow_style_adj_pr12 flow_style_adj_std log_num_stocks logturnover expenses2 total_loads2 size_score value_score mom_score iss_conform_all voteagainstmgmt_all sole_or_independent_all, cluster(mgmt_co) absorb(style year)
outreg using informed_t3.doc, bdec(3) starlevels(10 5 1) tdec(2) summstat(N\r2_a) nodisplay merge replace
reghdfe vote_alpha size fsize log_fund_age index_fund2 mret_style_adj_pr12 mret_style_adj_std flow_style_adj_pr12 flow_style_adj_std log_num_stocks logturnover expenses2 total_loads2 size_score value_score mom_score iss_conform_all voteagainstmgmt_all sole_or_independent_all, cluster(mgmt_co) absorb(style year)
outreg using informed_t3.doc, bdec(3) starlevels(10 5 1) tdec(2) summstat(N\r2_a) nodisplay merge replace

reghdfe informed informed_lag, cluster(mgmt_co) absorb(style year)
outreg using informed_t3.doc, bdec(3) starlevels(10 5 1) tdec(2) summstat(N\r2_a) nodisplay merge replace
reghdfe informed informed_lag size fsize log_fund_age index_fund2 mret_style_adj_pr12 mret_style_adj_std flow_style_adj_pr12 flow_style_adj_std log_num_stocks logturnover expenses2 total_loads2 size_score value_score mom_score iss_conform_all voteagainstmgmt_all sole_or_independent_all, cluster(mgmt_co) absorb(style year)
outreg using informed_t3.doc, bdec(3) starlevels(10 5 1) tdec(2) summstat(N\r2_a) nodisplay merge replace
reghdfe informed size fsize log_fund_age index_fund2 mret_style_adj_pr12 mret_style_adj_std flow_style_adj_pr12 flow_style_adj_std log_num_stocks logturnover expenses2 total_loads2 size_score value_score mom_score iss_conform_all voteagainstmgmt_all sole_or_independent_all, cluster(mgmt_co) absorb(style year)
outreg using informed_t3.doc, bdec(3) starlevels(10 5 1) tdec(2) summstat(N\r2_a) nodisplay merge replace


* Table 4: Persistence in having a high or low vote alpha
*** top ventile funds vs. others
reghdfe topv topv_lag size fsize log_fund_age index_fund2 mret_style_adj_pr12 mret_style_adj_std flow_style_adj_pr12 flow_style_adj_std log_num_stocks logturnover expenses2 total_loads2 size_score value_score mom_score iss_conform_all voteagainstmgmt_all sole_or_independent_all, cluster(mgmt_co) absorb(style year)
outreg using informed_t4a.doc, bdec(3) starlevels(10 5 1) tdec(2) summstat(N\r2_a) nodisplay replace
* bootstrapped 
bootstrap _b, r(1000) cluster(mgmt_co) seed(1): reghdfe topv topv_lag size fsize log_fund_age index_fund2 mret_style_adj_pr12 mret_style_adj_std flow_style_adj_pr12 flow_style_adj_std log_num_stocks logturnover expenses2 total_loads2 size_score value_score mom_score iss_conform_all voteagainstmgmt_all sole_or_independent_all, cluster(mgmt_co) absorb(style year)

*** top decile funds vs. others
reghdfe topd topd_lag size fsize log_fund_age index_fund2 mret_style_adj_pr12 mret_style_adj_std flow_style_adj_pr12 flow_style_adj_std log_num_stocks logturnover expenses2 total_loads2 size_score value_score mom_score iss_conform_all voteagainstmgmt_all sole_or_independent_all, cluster(mgmt_co) absorb(style year)
outreg using informed_t4a.doc, bdec(3) starlevels(10 5 1) tdec(2) summstat(N\r2_a) nodisplay merge replace
* bootstrapped 
bootstrap _b, r(1000) cluster(mgmt_co) seed(1): reghdfe topd topd_lag size fsize log_fund_age index_fund2 mret_style_adj_pr12 mret_style_adj_std flow_style_adj_pr12 flow_style_adj_std log_num_stocks logturnover expenses2 total_loads2 size_score value_score mom_score iss_conform_all voteagainstmgmt_all sole_or_independent_all, cluster(mgmt_co) absorb(style year)

*** top quintile funds vs. others
reghdfe informed informed_lag size fsize log_fund_age index_fund2 mret_style_adj_pr12 mret_style_adj_std flow_style_adj_pr12 flow_style_adj_std log_num_stocks logturnover expenses2 total_loads2 size_score value_score mom_score iss_conform_all voteagainstmgmt_all sole_or_independent_all, cluster(mgmt_co) absorb(style year)
outreg using informed_t4a.doc, bdec(3) starlevels(10 5 1) tdec(2) summstat(N\r2_a) nodisplay merge replace
* bootstrapped 
bootstrap _b, r(1000) cluster(mgmt_co) seed(1): reghdfe informed informed_lag size fsize log_fund_age index_fund2 mret_style_adj_pr12 mret_style_adj_std flow_style_adj_pr12 flow_style_adj_std log_num_stocks logturnover expenses2 total_loads2 size_score value_score mom_score iss_conform_all voteagainstmgmt_all sole_or_independent_all, cluster(mgmt_co) absorb(style year)

*** top quartile funds vs. others
reghdfe informedq4 informedq4_lag size fsize log_fund_age index_fund2 mret_style_adj_pr12 mret_style_adj_std flow_style_adj_pr12 flow_style_adj_std log_num_stocks logturnover expenses2 total_loads2 size_score value_score mom_score iss_conform_all voteagainstmgmt_all sole_or_independent_all, cluster(mgmt_co) absorb(style year)
outreg using informed_t4a.doc, bdec(3) starlevels(10 5 1) tdec(2) summstat(N\r2_a) nodisplay merge replace
* bootstrapped 
bootstrap _b, r(1000) cluster(mgmt_co) seed(1): reghdfe informedq4 informedq4_lag size fsize log_fund_age index_fund2 mret_style_adj_pr12 mret_style_adj_std flow_style_adj_pr12 flow_style_adj_std log_num_stocks logturnover expenses2 total_loads2 size_score value_score mom_score iss_conform_all voteagainstmgmt_all sole_or_independent_all, cluster(mgmt_co) absorb(style year)

*** top tercile funds vs. others
reghdfe topt topt_lag size fsize log_fund_age index_fund2 mret_style_adj_pr12 mret_style_adj_std flow_style_adj_pr12 flow_style_adj_std log_num_stocks logturnover expenses2 total_loads2 size_score value_score mom_score iss_conform_all voteagainstmgmt_all sole_or_independent_all, cluster(mgmt_co) absorb(style year)
outreg using informed_t4a.doc, bdec(3) starlevels(10 5 1) tdec(2) summstat(N\r2_a) nodisplay merge replace
* bootstrapped 
bootstrap _b, r(1000) cluster(mgmt_co) seed(1): reghdfe topt topt_lag size fsize log_fund_age index_fund2 mret_style_adj_pr12 mret_style_adj_std flow_style_adj_pr12 flow_style_adj_std log_num_stocks logturnover expenses2 total_loads2 size_score value_score mom_score iss_conform_all voteagainstmgmt_all sole_or_independent_all, cluster(mgmt_co) absorb(style year)


*** bottom ventile funds vs. others
reghdfe bottomv bottomv_lag size fsize log_fund_age index_fund2 mret_style_adj_pr12 mret_style_adj_std flow_style_adj_pr12 flow_style_adj_std log_num_stocks logturnover expenses2 total_loads2 size_score value_score mom_score iss_conform_all voteagainstmgmt_all sole_or_independent_all, cluster(mgmt_co) absorb(style year)
outreg using informed_t4b.doc, bdec(3) starlevels(10 5 1) tdec(2) summstat(N\r2_a) nodisplay replace
* bootstrapped 
bootstrap _b, r(1000) cluster(mgmt_co) seed(1): reghdfe bottomv bottomv_lag size fsize log_fund_age index_fund2 mret_style_adj_pr12 mret_style_adj_std flow_style_adj_pr12 flow_style_adj_std log_num_stocks logturnover expenses2 total_loads2 size_score value_score mom_score iss_conform_all voteagainstmgmt_all sole_or_independent_all, cluster(mgmt_co) absorb(style year)

*** bottom decile funds vs. others
reghdfe bottomd bottomd_lag size fsize log_fund_age index_fund2 mret_style_adj_pr12 mret_style_adj_std flow_style_adj_pr12 flow_style_adj_std log_num_stocks logturnover expenses2 total_loads2 size_score value_score mom_score iss_conform_all voteagainstmgmt_all sole_or_independent_all, cluster(mgmt_co) absorb(style year)
outreg using informed_t4b.doc, bdec(3) starlevels(10 5 1) tdec(2) summstat(N\r2_a) nodisplay merge replace
* bootstrapped 
bootstrap _b, r(1000) cluster(mgmt_co) seed(1): reghdfe bottomd bottomd_lag size fsize log_fund_age index_fund2 mret_style_adj_pr12 mret_style_adj_std flow_style_adj_pr12 flow_style_adj_std log_num_stocks logturnover expenses2 total_loads2 size_score value_score mom_score iss_conform_all voteagainstmgmt_all sole_or_independent_all, cluster(mgmt_co) absorb(style year)

*** bottom quintile funds vs. others
reghdfe bottomq bottomq_lag size fsize log_fund_age index_fund2 mret_style_adj_pr12 mret_style_adj_std flow_style_adj_pr12 flow_style_adj_std log_num_stocks logturnover expenses2 total_loads2 size_score value_score mom_score iss_conform_all voteagainstmgmt_all sole_or_independent_all, cluster(mgmt_co) absorb(style year)
outreg using informed_t4b.doc, bdec(3) starlevels(10 5 1) tdec(2) summstat(N\r2_a) nodisplay merge replace
* bootstrapped 
bootstrap _b, r(1000) cluster(mgmt_co) seed(1): reghdfe bottomq bottomq_lag size fsize log_fund_age index_fund2 mret_style_adj_pr12 mret_style_adj_std flow_style_adj_pr12 flow_style_adj_std log_num_stocks logturnover expenses2 total_loads2 size_score value_score mom_score iss_conform_all voteagainstmgmt_all sole_or_independent_all, cluster(mgmt_co) absorb(style year)

*** bottom quartile funds vs. others
reghdfe bottomq4 bottomq4_lag size fsize log_fund_age index_fund2 mret_style_adj_pr12 mret_style_adj_std flow_style_adj_pr12 flow_style_adj_std log_num_stocks logturnover expenses2 total_loads2 size_score value_score mom_score iss_conform_all voteagainstmgmt_all sole_or_independent_all, cluster(mgmt_co) absorb(style year)
outreg using informed_t4b.doc, bdec(3) starlevels(10 5 1) tdec(2) summstat(N\r2_a) nodisplay merge replace
* bootstrapped 
bootstrap _b, r(1000) cluster(mgmt_co) seed(1): reghdfe bottomq4 bottomq4_lag size fsize log_fund_age index_fund2 mret_style_adj_pr12 mret_style_adj_std flow_style_adj_pr12 flow_style_adj_std log_num_stocks logturnover expenses2 total_loads2 size_score value_score mom_score iss_conform_all voteagainstmgmt_all sole_or_independent_all, cluster(mgmt_co) absorb(style year)

*** bottom tercile funds vs. others
reghdfe bottomt bottomt_lag size fsize log_fund_age index_fund2 mret_style_adj_pr12 mret_style_adj_std flow_style_adj_pr12 flow_style_adj_std log_num_stocks logturnover expenses2 total_loads2 size_score value_score mom_score iss_conform_all voteagainstmgmt_all sole_or_independent_all, cluster(mgmt_co) absorb(style year)
outreg using informed_t4b.doc, bdec(3) starlevels(10 5 1) tdec(2) summstat(N\r2_a) nodisplay merge replace
* bootstrapped 
bootstrap _b, r(1000) cluster(mgmt_co) seed(1): reghdfe bottomt bottomt_lag size fsize log_fund_age index_fund2 mret_style_adj_pr12 mret_style_adj_std flow_style_adj_pr12 flow_style_adj_std log_num_stocks logturnover expenses2 total_loads2 size_score value_score mom_score iss_conform_all voteagainstmgmt_all sole_or_independent_all, cluster(mgmt_co) absorb(style year)



*** Figure 1
use "D:\Dropbox\InformedVoting\bins_plot.dta", clear
g mtna_int = int(mtna)
drop if num_funds < 15

graph twoway (lfit vote_alpha vote_alpha_lag_bin) (scatter vote_alpha vote_alpha_lag_bin, msymbol(circle_hollow)) 

*** local polynomials
graph twoway (lpolyci vote_alpha vote_alpha_lag_bin)
